package com.wu.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wu.entity.sys.SUserDo;
import com.wu.pojo.dto.SessionUserDto;
import com.wu.pojo.response.CommonIdNameResponse;
import com.wu.pojo.response.sys.UserListResponse;
import com.wu.pojo.response.sys.UserOptionListResponse;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 用户表 Mapper 接口
 * </p>
 *
 * @author wujilu
 * @since 2020-11-24
 */
public interface SUserMapper extends BaseMapper<SUserDo> {

    SessionUserDto getSUserDoByUsername(@Param("username") String userName);

    List<UserListResponse> userList(@Param("name") String name, @Param("departmentIds") List<Long> departmentIds);

    List<UserOptionListResponse> userOptionList(@Param("name") String name, @Param("departmentIds") List<Long> departmentIds);

    String getNameById(@Param("id")Long id);

    List<UserOptionListResponse> getUsersByIds(@Param("ids") List<Long> ids);

    List<CommonIdNameResponse> getUserByDepartmentId(@Param("departmentId") Long departmentId);

    List<UserOptionListResponse> getDepartmentUsersByIds(@Param("departmentIds") List<Long> departmentIds);
}
